package com.skyworth.web.admin.menu.repository;

import com.skyworth.web.admin.menu.domain.MenuCategoryModel;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by skyworth on 2016/8/8.
 */
public interface MenuCategoryRepository extends PagingAndSortingRepository<MenuCategoryModel, Long>{
//	@Query(value = "select mc from ff_menu_category mc where mc.menu_id=?1", nativeQuery = true)
//	public MenuCategoryModel findByMenuId(long menuId);
//
	@Query("select mc from MenuCategoryModel mc where mc.categoryId=?1 group by mc.categoryId")
	public List<MenuCategoryModel> findAllGroupByCategoryId(long categoryId);
//	Iterable<MenuCategoryModel> queryByCategoryId(long categoryId);

}
